<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>资产</title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
	<meta name="apple-mobile-web-app-capable" content="yes" />
	<meta name="screen-orientation" content="portrait">
	<meta name="full-screen" content="yes">
	<meta name="browsermode" content="application">
	<meta name="x5-orientation" content="portrait">
	<meta name="x5-fullscreen" content="true">
	<meta name="x5-page-mode" content="app">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="keywords" content="">
    <meta name="description" content="">
    <!-- css -->
    <link href="/zc/css/mui.min.css" rel="stylesheet">
    <link href="/zc/css/footer.css" rel="stylesheet">
    <link href="/zc/css/base.css" rel="stylesheet">
    <link href="/zc/css/mobileSelect.css" rel="stylesheet" />
    <!-- js -->
	<script src="/zc/js/jquery.min.js"></script>
    <script src="/zc/js/mui.min.js"></script>
	<script src="/zc/js/template.js"></script>
	<script src="/zc/js/flexible.js"></script>
    <script src="/zc/js/flexible_css.js"></script>
    <script src="/zc/js/foot_bar.js"></script>
    <script src="/zc/js/layer.js"></script>
    <script src="/zc/js/mobileSelect.min.js"></script>
    <script type="text/javascript" charset="utf-8">
        mui.init();
    </script>
    <style>
       a{ 
        text-decoration:none; 
        color:#333; 
        }
        a:hover{
            text-decoration:none; 
        }
    </style>
</head>
<body>
	<div id="app">
        <div class="sm_contain">
            <div class="assets_head">
                <div class="head1"><span>我的资产（净资产折合）</span> <img class="open_eye" data-type="0" src="/zc/img/open_eye.png" alt=""></div>
            </div>
            <div class="mui-slider">
                <div class="mui-slider-group">
                    <!--第一个内容区容器-->
                    <div class="mui-slider-item">
                        <div class="wk_zhz1">
                            <div class="wk_zh1" data-type="1"><span class="ns1">钱包账户</span><span class="ns2"><!-- （日累奖笔数 0/5） --></span> </div>
                            <div class="zh">
                                <span>折合</span>
                                <span class="zhzh" style="font-size: 18px;font-weight: bold"></span>
                                <span style="display: none" class="xinghao">****</span>
                                <span>USDT</span>
                            </div>
                            <div style="margin-top: .2rem">≈ <span class="ccny"></span> CNY</div>
                        </div>
                    <!-- 具体内容 -->
                    </div>
                    <!--第二个内容区-->
                    <div class="mui-slider-item">
                    <!-- 具体内容 -->
                        <div class="wk_zhz2">
                            <div class="wk_zh1"><span class="ns1">币币账户</span><span class="ns2"><!-- （日累奖笔数 0/5） --></span> </div>
                            <div class="zh">
                                <span>折合</span>
                                <span class="zhzh" style="font-size: 18px;font-weight: bold"></span>
                                <span style="display: none" class="xinghao">****</span>
                                <span>USDT</span>
                            </div>
                            <div style="margin-top: .2rem">≈<span class="ccny"></span>CNY</div>
                        </div>
                    </div>
                    <!--第三个内容区-->
                    <div class="mui-slider-item">
                    <!-- 具体内容 -->
                        <div class="wk_zhz3">
                            <div class="wk_zh1"><span class="ns1">OTC账户</span><span class="ns2"><!-- （日累奖笔数 0/5） --></span> </div>
                            <div class="zh">
                                <span>折合</span>
                                <span class="zhzh" style="font-size: 18px;font-weight: bold"></span>
                                <span style="display: none" class="xinghao">****</span>
                                <span>USDT</span>
                            </div>
                            <div style="margin-top: .2rem">≈<span class="ccny"></span>CNY</div>
                        </div>
                    </div>
                    <!--第四个内容区-->
                    <div class="mui-slider-item">
                    <!-- 具体内容 -->
                        <div class="wk_zhz4">
                            <div class="wk_zh1"><span class="ns1">挖矿账户</span><span class="ns2"><!-- （日累奖笔数 0/5） --></span> </div>
                            <div class="zh">
                                <span>折合</span>
                                <span class="zhzh" style="font-size: 18px;font-weight: bold"></span>
                                <span style="display: none" class="xinghao">****</span>
                                <span>USDT</span>
                            </div>
                            <div style="margin-top: .2rem">≈<span class="ccny"></span>CNY</div>
                        </div>
                    </div>
                    <!--第五个内容区-->
                    <div class="mui-slider-item">
                    <!-- 具体内容 -->
                        <div class="wk_zhz5">
                            <div class="wk_zh1"><span class="ns1">节点账户</span><span class="ns2"><!-- （日累奖笔数 0/5） --></span> </div>
                            <div class="zh">
                                <span>折合</span>
                                <span class="zhzh" style="font-size: 18px;font-weight: bold"></span>
                                <span style="display: none" class="xinghao">****</span>
                                <span>USDT</span>
                            </div>
                            <div style="margin-top: .2rem">≈<span class="ccny"></span>CNY</div>
                        </div>
                    </div>
                </div>
            </div>
            
            <div class="zc_hz lh1">
                <a class="zc_hz" style="color:#333;text-decoration: none;" href="/index/shop/assets_cb.html">
                   <div>
                    <img src="/zc/img/chongbi.png" alt="">
                    <span>充币</span>
                </div>
                </a>
                <a href="/index/shop/assets_tb_tbxq.html" style="color:#333;text-decoration: none;">
                <div class="ti">
                    <img src="/zc/img/tibi.png" alt="" style="float: left;margin-top: .08rem;">
                    <span>提币</span>
                </div>
                </a>
                <a class="zc_hz" style="color:#333;text-decoration: none;" href="/index/shop/h_transfer.html">
                <div>
                    <img src="/zc/img/zz_tb.png" alt="">
                    <span>划转</span>
                </div>
                </a>
                
            </div>
            <div class="zc_hz lh2">
                <div>
                    <img src="/zc/img/wym.png" alt="">
                    <span>我要买</span>
                </div>               
                <div>
                    <img src="/zc/img/wym1.png" alt="">
                    <span>我要卖</span>
                </div>
                <a class="zc_hz" style="color:#333;text-decoration: none;" href="/index/shop/h_transfer.html">
                <div>
                    <img src="/zc/img/zz_tb.png" alt="">
                    <span>划转</span>
                </div>
                 </a>
            </div>
            <div class="zc_hz lh3">
                <div>
                
                    <img src="/zc/img/jiaoyi.png" alt="">
                    <a href="/index/shop/OTC.html" style="color: #000">
                    <span>交易</span>
                    </a>
                </div>
               
                <a class="zc_hz" style="color:#333;text-decoration: none;" href="/index/shop/h_transfer.html">
                <div>
                    <img src="/zc/img/zz_tb.png" alt="">
                    <span>划转</span>
                </div>
                </a>
            </div>
            <div class="zc_hz lh4">
                 <a style="color:#333;text-decoration: none;" href="/index/shop/h_transfer.html">
                 <div>
                    <img src="/zc/img/zz_tb.png" alt="">
                 	<span>划转</span>
                 </div>
                 </a>
            </div>
            <div class="zc_hz lh5">
                <div class="suocang">
                    <img src="/zc/img/buc.png" alt="">
                    <span>补仓</span>
                </div>
                <a class="zc_hz" style="color:#333;text-decoration: none;" href="/index/shop/lock.html">
                <div class="zsc">
                    <img src="/zc/img/suoc.png" alt="">
                    <span>锁仓</span>
                </div>
                </a>
                <a class="zc_hz" style="color:#333;text-decoration: none;" href="/index/shop/h_transfer.html">
                <div>
                    <img src="/zc/img/zz_tb.png" alt="">
                    <span>划转</span>
                </div>
                </a>
            </div>
        </div>
        <div style="height: 5px;background: #EDEDED"></div>
            <div class="zclist_head">
                <div class="zcmx active">资产明细</div>
                <div class="zhls" data-type="5">账户流水</div>
                <div class="ns3 yc-zero" data-type="0" style="display: flex;display: -webkit-flex;align-items: center">
                    <img style="width: .373333rem;height: .373333rem;margin-right: .2rem" src="/zc/img/wxz.png" alt=""><span>隐藏为0的资产</span>
                </div>
            </div>
            <div class="cxk1">

            </div>
            <!-- <div class="cxk2">

            </div>
            <div class="cxk3">

            </div> 
            <div class="cxk4">

            </div>
            <div class="cxk5">

            </div> -->
        <!-- 结束 -->
        <div style="height: 1.466667rem"></div>
         <!-- 底部导航 -->
		<div class="foot_bar">
            <a href="/index/index/index">
                <div class="foot_block">
                    <img class="ws1" src="/zc/img/a_icon1.png" alt="">
                    <p>首页</p>
                </div>
            </a>
			<div class="foot_block">
				<img class="ws2" src="/zc/img/a_icon2.png" alt="">
				<p>OTC</p>
			</div>
			<div class="foot_block">
				<img class="ws3" src="/zc/img/a_icon3.png" alt="">
				<p>交易</p>
			</div>
			<div class="foot_block active">
				<img class="ws4" src="/zc/img/b_icon4.png" alt="">
				<p>资产</p>
			</div>
			<div class="foot_block">
				<img class="ws5" src="/zc/img/a_icon5.png" alt="">
				<p>我的</p>
			</div>            
        </div>  
    </div>
    <div class="wswc"></div>
    <div class="m-megess">
        <div class="title">请输入补仓数量</div>
        <div class="megess">
               <input class="number" type="number" style="height: 30px;width: 80%" placeholder="请输入锁仓数量">
        </div>
        <div class="m-btn">
            <div class="item" style="color:#333333" id="cancel">取消</div>
            <div class="item" style="color:#350161;font-weight: bold" id="submit1">确定</div>
        </div>
    </div>

</body>
</html>
	
<script type="text/html" id="cxk1">
    <% if(info == ''){%>
    <!-- 资产明细 -->
    <div class="zcmx_block1" >
        <img src="/zc/img/zwsj.png" alt="">
        <div class="wz">暂无数据</div>
    </div>
    <%}else{%>
    {{each info v i}}
    <!-- block1切换 -->
    <!-- 资产明细 -->
    <div class="zcmx_block2 wyyc{{i}}">
        <div class="head">{{v.name}}</div>
        <div class="content">
                <div>
                    <p class="ns1">可用</p>
                    <p class="wssl{{i}}">{{v.money}}</p>
                </div>
                <div style="text-align: center">  
                    <p class="ns1">冻结</p>
                    <p>0.00</p>
                </div>
                <!-- <div style="text-align: right">
                    <p class="ns1">奖励笔数</p>
                    <p>0</p>
                </div> -->
        </div>                    
    </div>
    {{/each}}
    <%}%>
</script>  

<script type="text/html" id="cxk2">
    
    <!-- block1切换 -->
    <% if(info == ''){%>
    <!-- 资产明细 -->
    <div class="zcmx_block1" >
        <img src="/zc/img/zwsj.png" alt="">
        <div class="wz">暂无数据</div>
    </div>
    <%}else{%>
    <!-- 资产明细 -->
    {{each info v i}}
    <div class="zcmx_block2 wyyc{{i}}">
        <div class="head">{{v.name}}</div>
        <div class="content">
                <div>
                    <p class="ns1">可用</p>
                    <p class="wssl{{i}}">{{v.money}}</p>
                </div>
                <div style="text-align: center">
                    <p class="ns1">委托</p>
                    <p>{{v.blowmoney}}</p>
                </div>
                <div style="text-align: right">
                    <p class="ns1">折合（CNY）</p>
                    <p>{{v.cny}}</p>
                </div>
        </div>     
    </div>
    {{/each}}
    <%}%>
    
</script>

<script type="text/html" id="cxk3">
    <!-- block1切换 -->
    <% if(info == ''){%>
    <!-- 资产明细 -->
    <div class="zcmx_block1" >
        <img src="/zc/img/zwsj.png" alt="">
        <div class="wz">暂无数据</div>
    </div>
    <%}else{%>
    <!-- 资产明细 -->
    {{each info v i}}
    <div class="zcmx_block2 wyyc{{i}}">
            <div class="head">{{v.name}}</div>
            <div class="content">
                    <div>
                        <p class="ns1">可用</p>
                        <p class="wssl{{i}}">{{v.money}}</p>
                    </div>
                    <!--
                    <div style="text-align: center">
                        <p class="ns1">划入待审 <img style="width: 14px;height: 13px" src="/zc/img/gth.png" alt=""></p>
                        <p>{{v.waitmoney}}</p>
                    </div>
                    <div style="text-align: center">
                        <p class="ns1">冻结</p>
                        <p>{{v.frostmoney}}</p>
                    </div>
                    -->
                    <% if(v.fieldtype == '1'){%>
                    <%}%>
                    <div style="text-align: center">
                        <p class="ns1">冻结</p>
                        <p>{{v.frostmoney}}</p>
                    </div>
                    <div style="text-align: right">
                        <p class="ns1">折合（CNY）</p>
                        <p>{{v.cny}}</p>
                    </div>
            </div>    
    </div>
    {{/each}}
    <%}%>

</script>

<script type="text/html" id="cxk4">

    <!-- block1切换 -->
    <% if(info == ''){%>
    <!-- 资产明细 -->
    <div class="zcmx_block1" >
        <img src="/zc/img/zwsj.png" alt="">
        <div class="wz">暂无数据</div>
    </div>
    <%}else{%>
    {{each info v i}}
    <!-- 资产明细 -->
    <div class="zcmx_block2 wyyc{{i}}">
            <div class="head">{{v.name}}</div>
            <div class="content">

            <% if(v.fieldtype == 2){%>
                <div>
                    <p class="ns1">待挖矿数量</p>
                    <p class="wssl{{i}}">{{v.staymoney}}</p>
                </div>
                <div style="text-align: center">
                    <p class="ns1">待转数量</p>
                    <p class="wssl{{i}}">{{v.waitmoney}}</p>
                </div>
                <div style="text-align: right">
                    <p class="ns1">可用数量</p>
                    <p class="wssl{{i}}">{{v.money}}</p>
                </div>
            <%}else{%>
                <div>
                    <p class="ns1">可用数量</p>
                    <p class="wssl{{i}}">{{v.money}}</p>
                </div>
                <div style="text-align: center">
                    <!-- <p class="ns1">可用</p>
                    <p>{{v.money}}</p> -->
                </div>
            <%}%>
            </div>

    </div>
    {{/each}}
    <%}%>
    <!-- 账户流水 -->
    <!--<div class="zcmx_block2" style="display:none">
            <div class="head">TRAC</div>
            <div class="content">
                    <div>
                        <p class="ns1">TRAC</p>
                        <p>+0.576589</p>
                    </div>
                    <div style="text-align: center">
                        <p class="ns1">余额</p>
                        <p>14.000</p>
                    </div>
                    <div style="text-align: right">
                        <p class="ns1">手续费</p>
                        <p>0.00</p>
                    </div>
            </div>     
    </div>-->
</script>

<script type="text/html" id="cxk5">
    <!-- block1切换 -->
    
    <% if(info == ''){%>
    <!-- 资产明细 -->
    <div class="zcmx_block1" >
        <img src="/zc/img/zwsj.png" alt="">
        <div class="wz">暂无数据</div>
    </div>
    <%}else{%>
    {{each info v i}}
    <div class="zcmx_block2 wyyc{{i}}">
        <div class="head">{{v.name}}</div>
        <div class="content">
                <div>
                    <p class="ns1">可用</p>
                    <p class="wssl{{i}}">{{v.money}}</p>
                </div>
                <div style="text-align: center">
                    <p class="ns1">冻结</p>
                    <p>{{v.frostmoney}}</p>
                </div>
                <div style="text-align: right">
                    <p class="ns1">折合（CNY）</p>
                    <p>{{v.cny}}</p>
                </div>
        </div>     
    </div>
    {{/each}}
    <%}%>
</script>

<script type="text/html" id="tpl-info">
    <% if(info == ''){%>
    <!-- 资产明细 -->
    <div class="zcmx_block1" >
        <img src="/zc/img/zwsj.png" alt="">
        <div class="wz">暂无更多数据</div>
    </div>
    <%}else{%>
	<!-- 账户流水 -->
    {{each info v i}}
    <div class="zcmx_block2" >
        <div class="head">{{v.name}} <span style="font-size: 5px;">{{v.createtime}}</span></div>
        <div class="content">
                <div>
                    <p class="ns1">数量</p>
                    <p>{{v.money}}</p>
                </div>
                <div style="text-align: center">
                    <p class="ns1">{{v.title}}</p>
                    <p>{{v.newmoney}}</p>
                </div>
                <div style="text-align: right">
                    <p class="ns1">手续费</p>
                    <p>{{v.fee}}</p>
                </div>
        </div>     
    </div>
    <%}else{%>
    <%}%>
    {{/each}}
    <%}%>
</script>

<script type="text/javascript">
    //获取滚动条当前的位置
    function getScrollTop() {
        var scrollTop = 0;
        if(document.documentElement && document.documentElement.scrollTop) {
            scrollTop = document.documentElement.scrollTop;
        } else if(document.body) {
            scrollTop = document.body.scrollTop;
        }
        return scrollTop;
    }
    //获取当前可视范围的高度  
    function getClientHeight() {
        var clientHeight = 0;
        if(document.body.clientHeight && document.documentElement.clientHeight) {
            clientHeight = Math.min(document.body.clientHeight, document.documentElement.clientHeight);
        } else {
            clientHeight = Math.max(document.body.clientHeight, document.documentElement.clientHeight);
        }
        return clientHeight;
    }
    //获取文档完整的高度 
    function getScrollHeight() {
        return Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
    }
	$('#cancel').click(function(){
        $('.m-megess').css('display','none')
        $('.wswc').css('display','none')
    })
    $('#submit1').click(function (e) { 
         $('.m-megess').css('display','none')
        $('.wswc').css('display','none')
        e.preventDefault();
        var number=$('.number').val();
        $.ajax({
            type: "POST",
            url: "/index/asset/mend",
            data: {number:number},
            dataType: "jsonp", 
            success: function (res) {
                console.log(res)
                if(res.code==0){
                    mui.toast(res.msg);
                }else{
                    mui.toast(res.msg);
                }
                
            }
        });
    });
    var status = true;
    var param = {
        page:1,
        limit:10,
        bursetype:''
    }   
    function getc1(type){
        $.ajax({
            type: "POST",
            url:"/index/asset/getCurrencyLog",
            data:param,
            dataType: "jsonp", 
            success: function (res) {
                $('.cxk1').append(template('cxk'+type, res));
                if(res.info=='' || res.info.length<param.limit){
                    status = false;
                } 
                 // 下拉加载
                 $(window).off("scroll").on("scroll", function(e){
                        if (getScrollTop() + getClientHeight() == getScrollHeight() && res.info!=''&& status){
                            if($('.zhls').hasClass('active')){
                            status = true;
                            param.page++;
                            getc1(type);
                            }
                        }
                    });
            }
        });
        
               
    }
    function getc(type){
        $('.zhls').removeClass('active');
        $('.zcmx').addClass('active');
        param.bursetype=type;
        $.ajax({
            type: "POST",
            url:"/index/asset/getCurrency",
            data:{bursetype:type},
            dataType: "jsonp", 
            success: function (res) {
                $('.cxk1').html(template('cxk'+type, res));
                var inde=type-1;
                $('.zhzh').eq(inde).html(res.converts);
                $('.ccny').eq(inde).html(res.allcny);                
                $('.yc-zero').off('click').click(function (e) { 
                    if($(this).data('type')=='0'){ 
                        $(this).data('type','1');
                        $(this).find('img').attr('src','/zc/img/xz.png');
                        for(var i=0;i<$('.zcmx_block2').length;i++){
                            if(parseInt($('.wssl'+i).html())=='0'){
                                $('.wyyc'+i).hide();
                            }
                        }
                    }else{                       
                        $(this).data('type','0');
                        $(this).find('img').attr('src','/zc/img/wxz.png');
                       
                        $('.zcmx_block2').show();
                    }
                });
                $('.suocang').click(function (e) { 
                    e.preventDefault();
                    $('.wswc').show();
                    $('.m-megess').show();
                });
                $('.zhls').off('click').click(function(){
                    $('.zhls').addClass('active');
                    $('.zcmx').removeClass('active');
                    param.page=1;
                    $('.cxk1').html('');
                    getc1(type);
                });
                $('.zcmx').off('click').click(function(){
                    $('.cxk1').html('');
                    getc(type);
                    $(this).addClass('active');
                    $('.zhls').removeClass('active');
                })
            }
        });
    }
    
    document.querySelector('.mui-slider').addEventListener('slide', function(event) {
        param.page=1;
        if (event.detail.slideNumber === 0) {
            //切换到第二个选项卡
            //根据具体业务，动态获得第二个选项卡内容；
            $('.lh1').css('display','flex');
            $('.lh2').hide();
            $('.lh3').hide();
            $('.lh4').hide();
            $('.lh5').hide();
        } else if (event.detail.slideNumber === 1) {
            //切换到第三个选项卡
            //根据具体业务，动态获得第三个选项卡内容；
            //改变标志位，下次直接显示
            $('.lh2').css('display','flex');
            $('.lh1').hide();
            $('.lh3').hide();
            $('.lh4').hide();
            $('.lh5').hide();
        }else if (event.detail.slideNumber === 2) {
            //切换到第三个选项卡
            //根据具体业务，动态获得第三个选项卡内容；
            //改变标志位，下次直接显示
            $('.lh3').css('display','flex');
            $('.lh1').hide();
            $('.lh2').hide();
            $('.lh4').hide();
            $('.lh5').hide();
        }else if (event.detail.slideNumber === 3) {
            //切换到第三个选项卡
            //根据具体业务，动态获得第三个选项卡内容；
            //改变标志位，下次直接显示
            $('.lh4').css('display','flex');
            $('.lh1').hide();
            $('.lh3').hide();
            $('.lh2').hide();
            $('.lh5').hide();
        }else if (event.detail.slideNumber === 4) {
            //切换到第三个选项卡
            //根据具体业务，动态获得第三个选项卡内容；
            //改变标志位，下次直接显示
            $('.lh5').css('display','flex');
            $('.lh1').hide();
            $('.lh3').hide();
            $('.lh4').hide();
            $('.lh2').hide();
        }
        getc(event.detail.slideNumber +1);
        $('.yc-zero').off('click').click(function (e) { 
                    if($(this).data('type')=='0'){ 
                        $(this).data('type','1');
                        $(this).find('img').attr('src','/zc/img/xz.png');
                        for(var i=0;i<$('.zcmx_block2').length;i++){
                            if(parseInt($('.wssl'+i).html())=='0'){
                                $('.wyyc'+i).hide();
                            }
                        }
                    }else{                       
                        $(this).data('type','0');
                        $(this).find('img').attr('src','/zc/img/wxz.png');
                       
                        $('.zcmx_block2').show();
                    }
                });
    }); 

    $(function(){ 
        $('.open_eye').click(function (e) { 
                    if($(this).data('type')=='0'){
                        $('.zhzh').hide();
                        $('.xinghao').show();
                        $(this).data('type','1');
                        $(this).attr('src','/zc/img/close_eye.png');
                    }else{
                        $('.zhzh').show();
                        $('.xinghao').hide();
                        $(this).data('type','0');
                        $(this).attr('src','/zc/img/open_eye.png');
                    }
                    
                });  
        getc(1);

	})
</script>
